package org.hishenframework.tool.codegenerate.method;

import java.util.List;

import org.hishenframework.tool.Inflector;

import freemarker.template.SimpleScalar;
import freemarker.template.TemplateMethodModelEx;
import freemarker.template.TemplateModelException;

/**
 * 成复数
 * @author ZhangDi
 *
 */
public class PluralizeTemplateMethodModelEx implements TemplateMethodModelEx {

	public Object exec(List arguments) throws TemplateModelException {
		String text = ( (SimpleScalar)arguments.get(0) ).getAsString();
		return Inflector.getInstance().pluralize(text);
	}

}
